package javacafe.daoimpl;

import java.sql.SQLException;
import java.util.Map;

import javacafe.dao.StudyMemberDAO;
import javacafe.dto.study.StudyAuthDTO;
import javacafe.dto.study.StudyMemberDTO;
import javacafe.ibatis.SqlDaoSuport;

public class StudyMemberDAOImpl extends SqlDaoSuport implements StudyMemberDAO {

	@Override
	public void insertMember(StudyMemberDTO dto) {
		try {
			getSqlMapper().insert("insertStudyMember", dto);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	@Override
	public StudyMemberDTO getStudyMember(Map<String, Integer> map) {
		StudyMemberDTO dto = null;
		try {
			dto = (StudyMemberDTO)getSqlMapper().queryForObject("getStudyMember", map);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return dto;
	}

	@Override
	public void addStudyAuth(StudyAuthDTO studyAuth) {
		try {
			getSqlMapper().insert("addStudyAuth", studyAuth);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	
}
